<%-- 
    Document   : editArticle
    Created on : Oct 26, 2012, 10:12:53 AM
    Author     : HAITHE
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<jsp:useBean id="articleCategoryModel" scope="session" class="Model.ArticleCategoryModel"/>
<c:set var="articleCates" value="${articleCategoryModel.allArticleCategory}"/>
<h3>Edit Article</h3>
<html:form action="/articleAction?action=edit">
    <table width="95%">
        <tr><td><b>Category</b></td><td>
                <html:select property="category_id">
                    <c:forEach  var="articleCate" items="${articleCates}">                                         
                        <html:option value="${articleCate.id}">
                            ${articleCate.name}
                        </html:option>
                    </c:forEach>
                </html:select></td></tr> 
        <tr><td><b>Title</b></td><td>
                <html:hidden property="id" value="${articleEdit.id}"/>
                <html:text property="title" value="${articleEdit.title}"/></td></tr>
        <tr><td><b>Content</b></td><td><html:textarea property="content" value="${articleEdit.content}"/></td></tr>
        <tr><td><b>Rate</b></td><td><html:text property="rate" value="${articleEdit.rate}"/></td></tr>
        <tr><td><b>Status</b></td><td>
                <html:radio  property="status" value="true"  />True
                <html:radio  property="status" value="false"/> False
            </td></tr> 
        <tr><td></td><td>
                <html:submit styleClass="button" value="Update"/>
                <html:reset styleClass="button"/>
            </td></tr>
    </table>
</html:form>